<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/css/base2.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/css/style2.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
<title>订单管理-订单列表</title>
</head>
<body>
	<div class="page">
		<div class="main_menu fl">
			<c:forEach items="${sessionScope.MENU_LIST}" var="mainMenu">
				<c:if test="${mainMenu.wOOpid == 1}">
					<div class="menu_name">
						<a href="${pageContext.request.contextPath}/${mainMenu.wOAction}"
							target="main"> <img
							src="${pageContext.request.contextPath}${mainMenu.wOIcon}">
							<p>${mainMenu.wOName}</p>
						</a>
					</div>
				</c:if>
			</c:forEach>
		</div>
		<div class="main_cont fl">
			<div class="main_cont_top">
				<div class="main_inner clearfix">

					<div class="cont_top_time fr">
						<i> <a
							href="${pageContext.request.contextPath}/morder/list/all/0/-1/0/1.html">
								<img
								src="${pageContext.request.contextPath}/images/images/refresh.png">刷新
						</a>
						</i>
					</div>
				</div>
			</div>
			<div class="main_cont_top">
						<div class="main_inner clearfix">
							<div class="cont_top_time fr">
								<select id="status">  
									<option value ="0" >全部订单</option>
									<option value ="1">待付款</option>
									<option value ="2">待分配</option>
									<option value ="3">待验收</option>
									<option value ="6">已确认</option>
									<option value ="7">已经结算</option>
								</select>
								<select id="serverType">  
									<option value ="-1" >全服务</option>
									<option value ="0">保洁订单</option>
									<option value ="1">开锁订单</option>
									<option value ="3">马桶维修</option>
									<option value ="2">管道疏通</option>
									<option value ="11">衣橱整理</option>
									<option value ="12">全屋整理</option>
								</select>
								<select id="supplier">  
									<option value ="0" >全部渠道商</option>
									 <c:forEach items="${SUPPLIER_LIST}" var="supplier">
										<option value="${supplier.id}">${supplier.wSName}</option>
									 </c:forEach>
								</select>
								订单号：<input class="Wdate" type="text" id="orderNo" >  <input type="button" value="订单搜索" onclick="ref()" class="search">
							</div>
						</div>
					</div>
			<div class="main_cont_bottom_duanqidan">
				<div class="main_inner">
					
					<table>
						<tr>
							<th><input type="checkbox" class="checked"></th>
							<th>订单编号</th>
							<th>服务渠道商</th>
							<th>订单类型</th>
							<th>服务地址</th>
							<th>地区</th>
							<th>服务开始时间</th>
							<th>服务时长</th>
							<th>服务人数</th>
							<th>订单总费用</th>
							<th>优惠</th>
							<th>订单状态</th>
							<th>操作</th>
						</tr>

						<c:forEach items="${PAGE_BEAN.dataList}" var="order">
							<tr style="color:
								<c:if test="${order.status == 1}">blue</c:if> 
								<c:if test="${order.status == 2}">red </c:if> 
							;"
							
							>
								<td><input type="checkbox" class="checked"
									value="${order.id}" name="idArray"></td>
								<td>${order.wOOrderNo }</td>
								<td>${order.orderDetailDO.wOSupplierName }</td>
								<td>${order.wOServiceName }</td>
								<td>${order.orderDetailDO.wOAddress }</td>
								<td>${order.orderDetailDO.wODistrict }</td>
								<td><fmt:formatDate
										value="${order.orderDetailDO.wOSubscribe }"
										pattern="yyyy-MM-dd HH:mm:ss" /></td>
								<td>${order.orderDetailDO.wOServerTime }</td>
								<td>${order.orderDetailDO.wOStaffCount }</td>
								<td>${order.wOFee }</td>
								<td>${order.wOCoupon }</td>
								<td><c:if test="${order.status == 1}">待付款</c:if> 
								<c:if test="${order.status == 2}">待分配</c:if> 
								<c:if test="${order.status == 3}">待验收</c:if> 
								<c:if test="${order.status == 4}">申请取消</c:if> 
								<c:if test="${order.status == 5}">已取消</c:if> 
								<c:if test="${order.status == 6}">已确认</c:if> 
								<c:if test="${order.status == 7}">已经结算</c:if>
								<c:if test="${order.status == 8}">已退款</c:if></td>
								<td>
									<button onclick="window.location.href='${pageContext.request.contextPath}/morder/detail/${order.id}.html'">查看详情</button>
								</td>
							</tr>
						</c:forEach>

					</table>
					<%@ include file="/WEB-INF/views/page.jsp"%>
				</div>
			</div>
		</div>
	</div>
	</div>
<script type="text/javascript">
	function ref() {
		var orderNo = document.getElementById('orderNo').value;
		var status = document.getElementById('status').value;
		var serverType = document.getElementById('serverType').value;
		var supplierId = document.getElementById('supplier').value;
		if(orderNo == '') {
			orderNo = 'all';
		}
		window.location.href='${pageContext.request.contextPath}/morder/list/' + orderNo + '/'+ status +'/' + serverType + '/' + supplierId +'/1.html';
	}
</script>
</body>
</html>
